package com.wx.chapter11.homework;

import com.wx.javacode.extend_.Pupil;

/**
 * @Author : 佩萁
 * Description :
 * @Create : 2023/6/14 - 10:58
 */
public class A {
    private String name = "小熊";

    void part() {
        class B {
            final private String NAME = "佩萁";

            void show() {
                System.out.println(NAME);
                System.out.println(A.this.name);//如果外部类属性和内部类属性一样，通过外部类名.this.属性名调用外部类属性，否则默认是就近原则调用
            }
        }
        //创建B类对象，调用方法
        B b = new B();
        b.show();
    }
}

class Test05 {
    public static void main(String[] args) {
        A a = new A();
        a.part();
    }
}